﻿using System.Collections.ObjectModel;
using Coniometer.Model;
using Prism.Mvvm;

namespace Coniometer.ViewModels
{
    public class PermissionPageViewModel : BindableBase
    {
        private ObservableCollection<UserRoleModel> _userRoleCollection = new ObservableCollection<UserRoleModel>();

        public ObservableCollection<UserRoleModel> UserRoleCollection
        {
            get => _userRoleCollection;
            set
            {
                _userRoleCollection = value;
                RaisePropertyChanged();
            }
        }

        public PermissionPageViewModel()
        {
            for (var i = 1; i < 15; i++)
            {
                var dataModel = new UserRoleModel
                {
                    Ordinal = $"00{i}",
                    UserRole = "管理员",
                    Permissions = "点位设置，数据查询，报警设置，时间设置，校准设置，数据导出，日志查询，删除功能，通道选择",
                    State = i % 2 == 0 ? "开启" : "关闭"
                };
                UserRoleCollection.Add(dataModel);
            }
        }
    }
}